View3DMF NetScape Plugin is an example of how to write a plug-in for the Netscape Navigator internet browser using QuickDraw™ 3D. It is basically a merge of two other samples:
ViewPict - the Netscape sample plugin
MetaFileRead - a QuickDraw™ 3D sample
The source code for the project has two significant files, which were copied from the original samples:
View3DMF.cp - adapted from ViewPict.cp in of the Netscape sample
MetaFileView.cp - adapted from the MetaFileReadSupport.c
It may be valuable to refer back to the original samples, if you have implementation questions.
--------------------------------------------
To install the plugin:
1. Make an alias of the file Netscape Plugin (found in the View3DMF Plugin folder).
2. Move that alias to the Plugins folder found in the same folder as your Netscape Navigator* application. (Remove any other QD3D plugins such as WhurlPlug™ from this folder.)
To test the plugin:
1. Start Netscape Navigator.
2. From the Finder, drag the icon view3DMF_TestPage.html onto the Netscape Navigator window. An image of a three dimensional cross should appear and rotate.
Try viewing other World Wide Web sites that have 3DMF data; for example:
http://product.apple.com/qd3d/QD3D.HTML
--------------------------------------------
IMPORTANT: To compile this sample you will need the Netscape Mac Plug-in SDK 2.0, which can be download from:
-Sometime when resizing the window, the View3DMF pane shrinks to a narrow pane about 5 pixels high at the upper left corner of the Netscape application window. This bug also appears in the ViewPict sample plug-in from Netscape's Mac Plug-in SDK 2.0. This bug is "fixed" by the idle time animation, but if you look closely after resizing the window (or if you disable the animation), you will see the shrunken pane.
-Printing causes a crash. Avoid it, for now.
--------------------------------------------
Future:
-I would like to clean up the sample by moving all the QuickDraw 3D ( ::Q3xxx() ) calls to MetaFileView.cp.
Other improvements left for the reader:
-Save file to disk: NPP_StreamAsFile()
-Drag & Drop
-Interaction with the model (i.e. grab, spin, zoom, etc.)
--------------------------------------------
Disclaimer: This code is provided as an example of how I wrote a Netscape Navigator Plug-in that displays QuickDraw 3D images. It is provided to you to inspire and help you get started thinking about the issues of implementing a QuickDraw 3D Netscape PlugIn. I do not mean to impy it is the only way, nor the best way, to implement QuickDraw 3D PlugIn. Furthermore this sample has not underegone rigorous quality testing (nor, as of this writing, has it undergone a code review); there probably are bugs beyond what was reported above. There may even parts that are implemented incorrectly. If you find bugs or incorrect implementation, I would appreciate it, if you would point them out to me by sending e-mail to revans@apple.com. Thank you.